package LeetCode;

import java.util.HashSet;

public class LC_026_RemoveDuplicatesfromSortedArray {
    public static void main(String[] args) {

    }

    public int removeDuplicates(int[] nums) {
        int len = nums.length;
        if (len == 0)
            return 0;
        int count = 1;
        for (int i = 1; i < len; i++) {
            if (nums[i] == nums[i - 1]) {
                continue;
            } else {
                nums[count] = nums[i];
                count++;
            }
        }
        return count;
    }

}
